package com.tic.robot.ui.fragment;


import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RelativeLayout;

import com.tic.robot.R;
import com.tic.robot.ui.activity.ControlerActivity;

/**
 * Created by Administrator on 2016/9/27.
 */
public class RobotFragment extends Fragment implements View.OnClickListener {

    RelativeLayout mNavControler, mNavActions, mNavNewAction;


    public static RobotFragment newInstance() {
        return new RobotFragment();
    }

    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View root = inflater.inflate(R.layout.fragment_robot, container, false);
        initView(root);
        return root;
    }

    private void initView(View view) {
        view.findViewById(R.id.nav_controler).setOnClickListener(this);
        view.findViewById(R.id.nav_action).setOnClickListener(this);
        view.findViewById(R.id.nav_new_action).setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        switch (v.getId()) {
            case R.id.nav_controler:
                startActivity(new Intent(getActivity(), ControlerActivity.class));
                break;
            case R.id.nav_action:
                break;
            case R.id.nav_new_action:
                break;
        }
    }
}